<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="utf-8" />
        <title>Calendar - ESUI Demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="assets/google-code-prettify/prettify.css" />
        <link rel="stylesheet" href="assets/themes/standard.css" />
        <!--[if lt IE 9]>
        <link rel="stylesheet" href="assets/ie8.css" />
        <![endif]-->
    </head>
    <body>
        <div class="header">
            <h1 id="branding">Calendar</h1>
        </div>
        <div class="ui-g main-container">
            <div id="side-bar" class="ui-u-1-5">
                <ul id="navigator" class="ui-nav">
                </ul>
            </div>
            <div id="main" class="ui-u-4-5">
                <h2>状态</h2>
                <div class="intro">
                    <p>通过设置属性<code>disabled:1</code>、<code>readOnly:1</code>可以改变日历的状态。</p>
                </div>
                <div class="example ui-demo-light-stage">
                    <div class="row">
                        <span class="cal-desc">默认样式：</span><input data-ui="type:Calendar" />
                    </div>
                    <div class="row">
                        <span class="cal-desc">不可用：</span><input data-ui="type:Calendar;disabled:1" />
                    </div>
                    <div class="row">
                        <span class="cal-desc">只读：</span><input data-ui="type:Calendar;readOnly:1" />
                    </div>
                </div>
                <h2>点击自动隐藏</h2>
                <div class="intro">
                    <p>设置属性<code>autoHideLayer:1</code>可以实现选中日期后日历自动隐藏。</p>
                </div>
                <div class="example ui-demo-light-stage">
                    <div class="row">
                        <input data-ui="type:Calendar;autoHideLayer:1"/>
                    </div>
                </div>
                <h2>错误提示</h2>
                <div class="intro">
                    <p>方法<code>showValidationMessage</code>可以显示错误提示。</p>
                </div>
                <div class="example ui-demo-light-stage">
                    <div class="row">
                        <input data-ui="type:Calendar;id:error"/>
                    </div>
                </div>
                <script type="text/sample">
                    ui.get('error').showValidationMessage('invalid', '时间错误！');
                </script>
                <h2>可选区间</h2>
                <div class="intro">
                    <p>方法<code>setRange</code>可以设定日历的可选区间。</p>
                </div>
                <div class="example ui-demo-light-stage">
                    <div class="row">
                        <input data-ui="type:Calendar;id:range"/>
                    </div>
                </div>
                <script type="text/sample">
                    ui.get('range').setRange({
                        begin: new Date(2015, 6, 3),
                        end: new Date(2015, 6, 7)
                    });
                </script>
            </div>
        </div>
        <script src="assets/loader/esl.js"></script>
        <script src="config.js"></script>
        <script src="demo.js"></script>
        <script src="assets/google-code-prettify/prettify.js"></script>
        <script id="main-js">
        require(
            [
                'esui',
                'esui/Calendar',
                'esui/Tab',
                'demo'
            ],
            function (ui) {
                ui.init();
                ui.get('error').showValidationMessage('invalid', '时间错误！');
                ui.get('range').setRange({
                    begin: new Date(2015, 6, 3),
                    end: new Date(2015, 6, 7)
                });
            }
        );
        </script>
        <script src="sitemap.js"></script>
    </body>
</html>
